<?php
declare (strict_types = 1);

namespace app\common\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Cart extends Model
{
    //
    /**
     * 建立商品基本信息的关系
     * @return \think\model\relation\HasOne
     */
    public function goods(){
        return $this->hasOne(Goods::class,'id','goods_id')->bind(['goods_name','goods_logo']);
    }

    /**
     * @return \think\model\relation\HasOne
     */
    public function specGoods(){
        return $this->hasOne(SpecGoods::class,'id','spec_goods_id')->bind(['value_names','price','store_count','store_frozen']);
    }

}
